package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OverhaulLibraryMapper;
import com.ruoyi.system.domain.OverhaulLibrary;
import com.ruoyi.system.service.IOverhaulLibraryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 大修库Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-10-29
 */
@Service
public class OverhaulLibraryServiceImpl implements IOverhaulLibraryService 
{
    @Autowired
    private OverhaulLibraryMapper overhaulLibraryMapper;

    /**
     * 查询大修库
     * 
     * @param id 大修库主键
     * @return 大修库
     */
    @Override
    public OverhaulLibrary selectOverhaulLibraryById(Long id)
    {
        return overhaulLibraryMapper.selectOverhaulLibraryById(id);
    }

    @Override
    public OverhaulLibrary getByName(String overhaul_name) {
        return overhaulLibraryMapper.getByName(overhaul_name);
    }

    /**
     * 查询大修库列表
     * 
     * @param overhaulLibrary 大修库
     * @return 大修库
     */
    @Override
    public List<OverhaulLibrary> selectOverhaulLibraryList(OverhaulLibrary overhaulLibrary)
    {
        return overhaulLibraryMapper.selectOverhaulLibraryList(overhaulLibrary);
    }

    /**
     * 新增大修库
     * 
     * @param overhaulLibrary 大修库
     * @return 结果
     */
    @Override
    public int insertOverhaulLibrary(OverhaulLibrary overhaulLibrary)
    {
        return overhaulLibraryMapper.insertOverhaulLibrary(overhaulLibrary);
    }

    /**
     * 修改大修库
     * 
     * @param overhaulLibrary 大修库
     * @return 结果
     */
    @Override
    public int updateOverhaulLibrary(OverhaulLibrary overhaulLibrary)
    {
        return overhaulLibraryMapper.updateOverhaulLibrary(overhaulLibrary);
    }

    /**
     * 批量删除大修库
     * 
     * @param ids 需要删除的大修库主键
     * @return 结果
     */
    @Override
    public int deleteOverhaulLibraryByIds(String ids)
    {
        return overhaulLibraryMapper.deleteOverhaulLibraryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除大修库信息
     * 
     * @param id 大修库主键
     * @return 结果
     */
    @Override
    public int deleteOverhaulLibraryById(Long id)
    {
        return overhaulLibraryMapper.deleteOverhaulLibraryById(id);
    }
}
